<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>持有刀具限制</title>
	<link href="/customer_plat/public/stylesheets/webix_3.0.4.css" rel="stylesheet" type="text/css">
       <link href="/customer_plat/public/stylesheets/common.css" rel="stylesheet" type="text/css">
    <script src="/customer_plat/public/javascripts/webix_3.0.4.js" type="text/javascript" charset="utf-8"></script>
	    <script src="/customer_plat/public/javascripts/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript">
	webix.ready(function() {
				var my_templaet = {
						template : "<span style='font-size:20px; font-weight:bold; color:#3498DB'; >操作员持有刀具限制</span>&nbsp;/&nbsp;&nbsp;OpertorCutterLimit",
					height : 45,
					borderless : true
				};
				var my_toolbar = {
					view : "toolbar",
					elements : [ {
						view : "datepicker",
						id : "sel_date",
						timepicker : true,
						label : "日期",
						labelAlign : "right",
						name : "end",
						hidden:true,
						stringResult : true,
						format : "%Y-%m-%d",
						width : 240
					},  {
						view : "button",
						value : "保存修改",
						width : 100,
						click : "save"
					} ]
				};
				var body = new webix.ui({
					container : "body",
					type : "line",
					id : "mylayout",
					rows : [ my_templaet, my_toolbar ],// ----rows结束----
				//----rows结束----
				});// ---webix.ui结束-
			});
</script>
<script type="text/javascript">
	$(function(){
		
		var jsonstr = $("#json").val();
		jsonstr = 	eval("(" + jsonstr + ")")
		var str = jsonstr.data
	 
	//	var data  = JSON.parse();
		if(str.operator_max_num!=-1){
			$("#max_num").val(str.operator_max_num);
		}
		if(str.operator_remind_num!=-1){
			$("#remind_num").val(str.operator_remind_num);
		}

	})
	function save(){
		var params = {};
		params["operator_max_num"] = $("#max_num").val();
		params["operator_remind_num"] = $("#remind_num").val();
		$.post("save",params,function(data){
			if(data.ret=="1001"){
				alert("执行失败,错误信息:"+data.msg);
			}else{
				alert("执行成功");
				location.reload();

			}	
		
		})		
	}
	</script>
</head>
<body>
	<div id="body">
	</div>
		<input hidden value="${obj}" id="json">
		<div style="margin:30px;color: #666;">
		<span>
		操作员持有刀具超过&nbsp;<input id="remind_num" type="text" style="border-radius:6px; width: 60px;" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D*/g,'')" maxlength="6" />&nbsp;提醒(如若无限制则置为空,只能输入正整数)</span>
		<br>
				<br>
		<span>
		操作员最大持有刀具&nbsp;<input id="max_num" type="text" style="border-radius:6px; width: 60px;" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D*/g,'')" maxlength="6"/>&nbsp;数量(如若无限制则置为空,只能输入正整数)</span>
		</div>
</body>
	
</html>